<template>
    <lay-layer v-model="storeMain.connect.dialog_show" title="添加" move="false"
               type="drawer" offset="t" :btn="btnButton" btnAlign="c"
               :area="['600px', '400px']">
        <div style="padding: 20px;">
            <lay-form :model="storeMain.connect.connecttform" pane="true" label-width="150" size="sm" required>
                <lay-form-item label="数据库类型" prop="sqltype">
                    <lay-select v-model="storeMain.connect.connecttform.sqltype" style="width:100%;">
                        <lay-select-option value="mysql" label="mysql"></lay-select-option>
                        <lay-select-option value="postgresql" label="postgresql"></lay-select-option>
                        <lay-select-option value="oracle" label="oracle"></lay-select-option>
                    </lay-select>
                </lay-form-item>
                <lay-form-item label="名称" prop="title">
                    <lay-input v-model="storeMain.connect.connecttform.title"></lay-input>
                </lay-form-item>
                <lay-form-item label="地址" prop="address">
                    <lay-input v-model="storeMain.connect.connecttform.address"></lay-input>
                </lay-form-item>
                <lay-form-item label="端口" prop="port">
                    <lay-input v-model="storeMain.connect.connecttform.port"></lay-input>
                </lay-form-item>
                <lay-form-item label="账户" prop="username">
                    <lay-input v-model="storeMain.connect.connecttform.username"></lay-input>
                </lay-form-item>
                <lay-form-item label="密码" prop="password">
                    <lay-input v-model="storeMain.connect.connecttform.password" type="password">></lay-input>
                </lay-form-item>
            </lay-form>
        </div>
    </lay-layer>
</template>
<script setup>
import {ref} from 'vue'
import {useStoreMain} from '../../store/storeindex.js';
const storeMain = useStoreMain();
const btnButton = [
    {
        text: '保存', callback: () => {
            storeMain.connect.addConnect();
        }
    },
    {
        text: '取消', callback: () => {
            alert("取消事件")
        }
    }
]
function handleClick(type) {
    console.log(type);
    if (type == 'home') {
        storeMain.publicmain.currenttab = 'home'
    }
}
</script>
<style lang="scss" scoped>
.connleftmenu {
    width: 40px;
    height: 100%;
    background-color: var(--base_color);
    display: flex;
    flex-flow: column nowrap;
    justify-content: start;
    align-items: start;
    .box {
        display: flex;
        flex-flow: column nowrap;
        justify-content: center;
        align-items: center;
        margin-top: 20px;
        border: 0px solid #000;
        a {
            margin: 10px 5px;
        }
    }
}
.is-active {
    background-color: #605eda;
}
</style>
